[codex] Add reparent E2E scenarios#530
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: NONE FindingsNo findings. NotesThe scoped diff only changes ProtoFleet Playwright E2E fixtures, page objects, helpers, and a new I reviewed Generated by Codex Security Review | |
1447f24 to
2691f13
Compare
There was a problem hiding this comment.
Pull request overview
Adds new ProtoFleet Playwright E2E coverage for “reparent” workflows (rack → building, miner → site, miner → rack), plus a small page-object tweak and a CI workflow adjustment to run the new spec without setup-project dependencies.
Changes:
- Added
minersReparent.spec.tswith three end-to-end reparent scenarios, including setup/cleanup and request-payload assertions. - Updated
RacksPage.clickSaveRack()to scope the “Save” click to the full-screen modal. - Updated the ProtoFleet E2E GitHub Actions workflow to set
PW_UI_NO_DEPS=1for the new spec shard.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
client/e2eTests/protoFleet/spec/minersReparent.spec.ts |
New Playwright spec covering three reparent operator workflows with request + UI assertions. |
client/e2eTests/protoFleet/pages/racks.ts |
Makes rack “Save” interaction more specific by scoping it to the full-screen modal. |
.github/workflows/protofleet-e2e-tests.yml |
Skips setup project dependencies for the new spec shard via PW_UI_NO_DEPS=1. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2666a50874
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const continueButton = this.page.getByRole("button", { name: "Continue", exact: true }); | ||
| if (await continueButton.isVisible().catch(() => false)) { | ||
| await continueButton.click(); |
There was a problem hiding this comment.
Wait for the site-move conflict dialog
When cleanup restores a miner that originally belonged to another site after the assign-to-rack scenario, the miner is still in the temporary rack/site, so AssignDevicesToSite first returns the cross-site rack conflict and renders a Continue dialog asynchronously. This immediate isVisible() check can run before that dialog appears, causing the helper to return without force-clearing the rack membership; the following cleanup then runs with the modal still open and can leave the miner/rack placement dirty. Wait briefly for either the dialog and click it, or for the picker to close, before returning.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e29e459c2c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const snapshots = body.snapshots ?? body.miners ?? []; | ||
| if (snapshots.length === 0) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
Match only the visible miners request
When the Fleet layout mounts, CompleteSetup also sends ListMinerStateSnapshots requests for auth-needed/pool-needed counts before the Miners table request. This handler resolves on the first non-empty response regardless of its request filter, so in environments with any auth-required miners it can hand captureMovableMiner only those background snapshots; the later loop skips auth-required rows and throws even though the visible miners list contains valid candidates. Keep listening until the response matches the table request or the visible IPs instead of resolving on any non-empty response.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4c2f1e564
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| await this.clickViewList(); | ||
| await this.waitForRackListToLoad({ allowEmpty: false }); | ||
| return await this.getRackId(label); |
There was a problem hiding this comment.
Handle created racks beyond the first page
In orgs with more than one page of racks, the racks tab is paginated and defaults to name-ascending order, but this helper switches to list view and immediately parses the row from the current page only. A newly generated label like miner_rack_*/reparent_rack_* can sort after 50 existing racks, so getRackId(label) times out before the reparent assertions even run when the suite is pointed at a larger seeded or real fleet. Filter/search for the created label or page until it is visible before reading the id.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4100180649
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| private async selectParentPickerTarget(label: string) { | ||
| const modal = this.page.getByTestId("modal"); | ||
| await modal.getByText(label, { exact: true }).click(); |
There was a problem hiding this comment.
Page the rack picker before selecting labels
When the org has more than 50 racks, the rack ParentPicker only renders one page at a time (ParentPickerModal uses PAGE_SIZE = 50 for kind === "rack"), but this helper clicks the label on the currently visible page only. In the new miner-to-rack scenario, a freshly created miner_rack_* (or an original rack during cleanup) can sort beyond the first page, so this click times out even though the rack exists; page through the picker or filter/search before selecting the label.
Useful? React with 👍 / 👎.
Reviewable diff: +0/-0 across 0 files (excludes generated, test, and story files).
Summary
This PR adds ProtoFleet E2E coverage for three reparent workflows that operators can trigger from the existing Fleet surfaces: moving a rack to a building, assigning a miner to a site, and assigning a miner to a rack. The spec verifies the network requests and resulting UI state for each flow, while also handling the local dev configuration where multi-site Fleet tabs may be disabled and the legacy sites/settings routes remain the stable management surface.
How it works
The new Playwright spec provisions temporary sites, buildings, and racks as needed, performs the reparent action from the Racks or Miners tab, then validates the request payload sent to the backend and the resulting placement state visible in the app. For local environments where
VITE_MULTI_SITE_ENABLEDis off, setup and cleanup use the legacy/settings/sitesand related site-scoped building surfaces, but the user actions under test still happen from the Fleet Racks and Miners tabs.Diagrams
Areas of the code involved
client/e2eTests/protoFleet/spec/minersReparent.spec.tsKey technical decisions & trade-offs
Testing & validation
./node_modules/.bin/eslint e2eTests/protoFleet/spec/minersReparent.spec.tsPW_UI_NO_DEPS=1 npx playwright test spec/minersReparent.spec.ts --project=desktop